package com.ruoyi.business.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.business.domain.SysArea;
import com.ruoyi.business.mapper.SysAreaMapper;
import com.ruoyi.business.service.ISysAreaService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 【地市信息查询】Service业务层处理
 *
 * @author Tellsea
 * @date 2024-12-23
 */
@Service
public class SysAreaServiceImpl extends ServiceImpl<SysAreaMapper, SysArea> implements ISysAreaService {


    @Override
    public List<SysArea> getProv() {
        QueryWrapper<SysArea> wrapper = new QueryWrapper<>();
        wrapper.eq("deep","0");
        wrapper.eq("status","0");
        wrapper.orderByAsc("id");
        return this.baseMapper.selectList(wrapper);
    }

    @Override
    public List<SysArea> getChildArea(String id) {
        QueryWrapper<SysArea> wrapper = new QueryWrapper<>();
        wrapper.eq("pid",id);
        wrapper.eq("status","0");
        wrapper.orderByAsc("id");
        return this.baseMapper.selectList(wrapper);
    }

    @Override
    public List<SysArea> getAllArea() {
        QueryWrapper<SysArea> wrapper = new QueryWrapper<>();
        return this.baseMapper.selectList(wrapper);
    }

}
